/**
 * @file{初始化db}
*/
'use strict'

const { Sequelize } = require('../../azeroth').sequelize;

class InitDb {

    constructor( config ) {
        try {
            this.sequelize = new Sequelize(config.database, config.user, config.password, {
                host: config.host,
                port: config.port,
                dialect: 'mysql',
                timezone: "+08:00"
            });
        } catch (error) {
            console.log(error);
        }
    }
    static get_instance (config) {
        return new InitDb(config);
    }
}

module.exports = InitDb;